import React from 'react';
import Button from '@components/common/Button.jsx'
import styles from './Home.module.css'; // 引入样式文件
const Home = ({history}) => {
    const btnClick =(path)=>{
        console.log('点击了按钮')
        history.push(path); // 使用 history 对象进行路由跳转
    }
    return (
        <div className={styles.homeContainer}>
            <div className={styles.homeLeft}>
            <h1>W-Life</h1>
            <h1 >My Home</h1>
            <p style={{marginTop:'20px',marginBottom:'40px'}}>这是一个基础的 React 应用程序示例。</p>
            <Button btnTxt="井字棋" btnClick={()=>btnClick('/game/tictactoe')}/>
            <Button btnTxt="五子棋" btnClick={()=>btnClick('/game/gobang')}/>
            <Button btnTxt="魔方" btnClick={()=>btnClick('/game/RubiksCube')}/>
            </div>
            <div className={styles.homeRight}>
                广告位招租！
            </div>
        </div>
    );
};

export default Home;